package com.moyu.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.moyu.article.domain.comment.Comment;
import com.moyu.article.domain.comment.dto.CommentItemQueryDTO;
import com.moyu.article.domain.comment.dto.CommentQueryDTO;
import com.moyu.article.domain.comment.dto.DetailQueryDTO;
import com.moyu.article.domain.comment.vo.CommentListVO;
import com.moyu.article.domain.comment.vo.CommentQueryVO;
import com.moyu.article.domain.comment.vo.CommentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @Author 赵彦博
 * @Date 2025/3/30 9:28
 */
@Mapper
public interface CommentMapper extends BaseMapper<Comment> {

    List<CommentVO> list(CommentQueryDTO query);

    List<String> getCommentByPost(DetailQueryDTO dto);

    int updateStatus(String commentId, int status);

    CommentListVO getCommentItem(CommentItemQueryDTO dto);

    Boolean checkUserLike(Long commentId, Long currentUserId);

    List<CommentListVO> selectCommentList(CommentItemQueryDTO dto);

    List<CommentQueryVO> selectCommentsByPostId(@Param("postId") Long postId, @Param("userId") Long userId);
    int insertComment(Comment  comment);
    int checkCommentLikeStatus(@Param("commentId") Long commentId, @Param("userId") Long userId);
    int countCommentLikes(Long commentId);

    int insertCommentLike(@Param("commentId") Long commentId, @Param("userId") Long userId);
    int deleteCommentLike(@Param("commentId") Long commentId, @Param("userId") Long userId);
}
